<template slot="footer">
  <a-drawer
    title="详情"
    width="580"
    :closable="false"
    :visible="modalVisible"
    @close="handleCancel"
  >
    <a-form :form="form">
    <div class="param">
      <div class="left">挂号患者:</div>
      <div class="right"> {{ info.patientName }}</div>
    </div>
    <div class="param border-none">
      <div class="left">患者性质:</div>
      <div class="right">{{ info.registerNature }}</div>
    </div>
    <div class="space-line"></div>
    <div class="param">
      <div class="left">预约医院:</div>
      <div class="right">{{ info.registerHospitalName }}</div>
    </div>
    <div class="param">
      <div class="left">所属科室:</div>
      <div class="right">{{ info.departmentName }}</div>
    </div>
    <div class="param">
      <div class="left">医生信息:</div>
      <div class="right">{{ info.doctorName }}-{{ info.title }}</div>
    </div>
    <div class="param">
      <div class="left">就诊号种:</div>
      <div class="right">{{ info.type }}</div>
    </div>
    <div class="param">
      <div class="left">就诊时间:</div>
      <div class="right">{{ info.visitTime }} {{ info.visitPart }}</div>
    </div>
    <div class="param">
      <div class="left">就诊序号:</div>
      <div class="right">{{ info.visitNum }}</div>
    </div>

    <div class="param">
      <div class="left">挂号费用:</div>
      <div class="right">
        <span style="color: #d09579;" >￥</span>
        {{ info.price }}</div>
    </div>
    <div class="param">
      <div class="left">下单时间:</div>
      <div class="right">
        {{ info.registerTime}}</div>
    </div>

    <div class="param">
      <div style="float:left">挂号状态:</div>
      <div class="right" v-if="info.status==0 || info.status== ''">待支付</div>
      <div class="right" v-else-if="info.status==1 || info.status==2">挂号成功</div>
      <div class="right" v-else-if="info.status==3">挂号失败</div>
      <div class="right" v-else-if="info.status==4">已退款</div>
      <div class="right" v-else>已失效</div>
    </div>
    <div class="param border-none cont" v-show="info.failReason != null">
      <div class="left">失败原因:</div>
      <div class="right reason">{{info.failReason}}</div>
    </div>


  </a-form>
    <div
      :style="{
          position: 'absolute',
          bottom: 0,
          width: '100%',
          borderTop: '1px solid #e8e8e8',
          padding: '10px 16px',
          textAlign: 'right',
          left: 0,
          background: '#ffffff',
          borderRadius: '0 0 4px 4px',
        }"
    >
      <a-button @click="handleCancel" type="primary"  style="width: 540px">关闭</a-button>
    </div>
  </a-drawer>

</template>
<script>
  import { httpAction, getAction,putAction } from '@api/manage'

  const map = {boolean: {0: '否', 1: '是', 2: '不知道'}}

  export default {
    name: 'DoctorRegisterModal',
    components: {
    },
    inject: ['reload'],

    data() {
      return {
        title: '挂号管理',
        modalVisible:false,
        labelCols: {
          xs: { span: 24 },
          sm: { span: 3 },
        },
        wrapperCols: {
          xs: { span: 26 },
          sm: { span: 18 },
        },
        info:{},
        form: this.$form.createForm(this),

        url: {
          details: "/doctorRegisterRecord/doctorRegisterRecord/details"
        },
      }
    },
    created() {
      this.viewShow();
    },
    methods: {
      viewShow(record) {
        let attr = {};
        attr.recordId = record.id;
        getAction(this.url.details, attr).then((res)=>{
          if(res.code === 200){
            this.info = res.result
          }else{
            this.$message.warning(res.message)
          }
        }).catch((error)=>{
          console.log(error);
        })
        this.modalVisible = true;
      },
      handleCancel() {
        this.modalVisible = false;
      }
    }
  }
</script>

<style lang="less" scoped>
.ant-form-item {
  box-sizing: border-box;
  padding: 0;
  color: rgba(0, 0, 0, 0.65);
  font-size: 14px;
  font-variant: tabular-nums;
  line-height: 1.5;
  list-style: none;
  font-feature-settings: 'tnum';
  margin-bottom:5px;
  vertical-align: top;
}
.param{
  height: 42px;
  line-height: 42px;
  border-bottom: 1px solid #ccc;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
.param .left{
  min-width: 75px;
}
.param.border-none{
  border: none;
}
.param.cont{
  height: auto;
  line-height: normal;
}
.param.cont .left{
  height: 42px;
  line-height: 42px;
}
.param.cont .right{
  line-height: 25px;
  padding-top: 9px;
}
.param .reason{
  overflow: hidden;
  padding-bottom: 5px;
}
.space-line{
  width: 100%;
  height: 10px;
  background:rgb(243 237 237);
}
</style>